Skip to main content

From Json File

Install Plugin

npm install gatsby-transformer-json

In the config file

  • Take note of where your JSON files are stores in this case I created a folder in ./src/data
`gatsby-transformer-json`,
{
resolve: `gatsby-source-filesystem`,
options: {
path: `./src/data/`,
},
},

Example .json file

[
{
"question": "Something",
"value": "a",
},
{
"question": "Something",
"value": "a",
},
{
"question": "Something",
"value": "a",
},
]